package com.fastloan.core.apiauth.base.factory;

import com.fastloan.core.apiauth.base.enums.EncryptModeEnum;
import com.fastloan.core.apiauth.base.util.EncryptTool;

import java.util.function.Function;

/**
 * 加密模式工厂
 *
 * @author yanwe
 * createTime 2018-01-2018/1/3 9:33
 */
public class EncryptModeFactory {

    public static Function<String,String> getSignFunction(EncryptModeEnum encryptMode) {
        switch (encryptMode){
            case MD5:
                return EncryptTool::EncoderByMd5;
            default:
                throw new IllegalArgumentException("未知的签名方式");
        }
    }
}
